<template>
  <div class="root">
    <van-nav-bar
      left-arrow
      @click-left="$router.back()"
      style="backgroundColor: #e1473f"
    />
    <div class="vip">
      <span>黑胶VIP</span>
      <div>新用户首次登录免费得VIP周卡</div>
      <div>限从未领过VIP的新用户，需用实名认证的中国大陆手机号</div>
      <a>海量曲库</a>
      <a>无损音质</a>
      <a>免广告</a>
      <a>个性装扮</a>
    </div>
    <div class="login">
      <div class="phoneLogin" @click="phoneLogin">手机号登录</div>
      <div class="wxLogin">微信登录</div>
      <van-checkbox icon-size="12px" shape="square" v-model="checked"
        >同意服务条款，隐私政策</van-checkbox
      >
    </div>

    <van-overlay :show="show">
      <div class="wrapper" @click="show = false">
        <div class="block" @click.stop>
          <van-form @submit="onSubmit">
            <van-field v-model="phoneNumber" name="phoneNumber" type="number" label="手机号" :rules="[{ required: true, message: '请填写手机号' }]" />
            <div style="margin: 16px">
              <van-button round block type="info" native-type="submit"
                >提交</van-button
              >
            </div>
          </van-form>
        </div>
      </div>
    </van-overlay>
  </div>
</template>

<script>
export default {
  data() {
    return {
      checked: true,
      show: false,
      phoneNumber: '',
      password:''
    };
  },
  methods: {
    phoneLogin() {
      this.show = true;
    },
    onInput(value) {
      Toast(value);
    },
    onDelete() {
      Toast("删除");
    },
    onSubmit(values) {
      this.show=false;
      console.log('submit', values);
    },
  },
};
</script>

<style scoped lang="less">
.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.block {
  width: 6.6667rem;
  height: 5.3333rem;
  background-color: #fff;
  position: relative;
  .van-button {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translate(-50%);
    width: 90%;
    border-radius: 1.3333rem;
  }
  .van-field {
    width: 90%;
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%);
    border-bottom: 1px solid black;
  }
}
.root {
  width: 10rem;
  height: 17.7867rem;
  background-color: #e1473f;
  .vip {
    height: 3.7333rem;
    width: 6.6667rem;
    position: absolute;
    left: 50%;
    top: 15%;
    transform: translate(-50%);
    padding: 0.2667rem;
    background-color: rgba(255, 255, 255, 0.2);
    color: rgb(81, 80, 80);
    border-radius: 0.2667rem;
    span:nth-child(1) {
      font-size: 0.42rem;
    }
    span:nth-of-type(2) {
      font-size: 0.32rem;
    }
    div:nth-of-type(1) {
      font-size: 0.4267rem;
      color: #fff;
      margin: 10px;
    }
    div:nth-of-type(2) {
      font-size: 0.32rem;
    }
    a {
      font-size: 12px;
      padding: 0.2133rem;
    }
    a:nth-of-type(-n + 3) {
      border-right: 1px solid gray;
    }
  }
  .login {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%);
    margin: 0px auto;
    .phoneLogin {
      background-color: #fff;
      width: 6.6667rem;
      height: 0.9333rem;
      line-height: 0.9333rem;
      border-radius: 0.4667rem;
      font-size: 0.48rem;
      text-align: center;
      margin: 0.4rem;
      color: #e1473f;
    }
    .wxLogin {
      width: 6.6667rem;
      height: 0.9333rem;
      line-height: 0.9333rem;
      border-radius: 0.4667rem;
      font-size: 0.48rem;
      text-align: center;
      margin: 0.4rem;
      background-color: none;
      border: 1px solid #fff;
      color: #fff;
    }
    .van-checkbox {
      font-size: 0.32rem;
      margin-left: 1.8667rem;
    }
  }
}
</style>